<include file="public@header" />
</head>
<body>
	
	<div class="wrap js-check-wrap">
		<div>
			<h4>{$company.company_name} 员工管理</h>
		</div>

		<ul class="nav nav-tabs">
			<li class="active"><a href="">员工列表(<php>echo count($user);</php>)</a></li>
			<li><a href="{:url('user/add')}">员工添加</a></li>

			
		</ul>
        <form class="well form-inline margin-top-20" method="post" action="{:url('User/index')}">
            关键词:
            <input type="text" class="form-control" name="username" style="width: 200px;" value="{$data['username']|default=''}" placeholder="员工编号/姓名模糊查询...">
            部门: 
            <select name="department" class="form-control">
                <option value="0"  <?php if($data['department']=='0') {echo 'selected';} ?>  >全部</option>
                <volist name="departments" id="vo">
                    <option value="{$vo.id}"    <?php if($data['department']==$vo['id']) {echo 'selected';} ?>     >{$vo.name}</option>
                </volist>  
            </select>
            <input type="submit" name="search" class="btn btn-primary" value="搜索" />
        </form>
        <table class="table table-bordered">
        	<thead>
        		<tr>
        			<th style="width: 50px;">	ID</th>
        			<th>	员工姓名</th>
        			<th>	员工编号</th>
        			<th>	所在部门</th>
        			<th>担任岗位	</th>
        			<th>	最后登录IP</th>
        			<th>	最后登录时间</th>
        			<th>	电话号码</th>
        			<th>	邮箱</th>
        			<th>	状态</th>
        			<th>	操作</th>
        		</tr>
        	</thead>
        	<tbody>
        		<volist name="user" id="vo">
        		<tr>
        			<td>{$vo.id}</td>
        			<td><a href="{:url('user/xiangxi','id='.$vo.id)}">{$vo.user_login}</a></td>
        			<td style="font-size: 16px;font-weight: 800;letter-spacing: 1px;">{$vo.employee_id}</td>
        			<td>{$vo.department|default='未分配部门'}</td>
        			<td>{$vo.role|default='未分配角色'}</td>
        			<td>{$vo.last_login_ip}</td>
        			<td>
        				<if condition="$vo['last_login_time'] eq 0">
							{:lang('USER_HAVE_NOT_LOGIN')}
						<else />
							{:date('Y-m-d H:i:s',$vo['last_login_time'])}
						</if>
					</td>
        			<td>{$vo.mobile}</td>
        			<td>{$vo.user_email}</td>
        			<td>
        				<php>$s=['禁用','正常','未验证'];echo $s[$vo['user_status']];</php>
        			</td>
        			<td>
        				<a href='{:url("user/edit",array("id"=>$vo["id"],"company"=>$vo["company_id"]))}'>{:lang('EDIT')}</a>
							<a class="js-ajax-delete" href="{:url('user/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
							<if condition="$vo['user_status'] eq 1">
								<a href="{:url('user/ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="{:lang('BLOCK_USER_CONFIRM_MESSAGE')}">{:lang('BLOCK_USER')}</a>
							<else />
								<a href="{:url('user/cancelban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>
							</if>
        			</td>
        		</tr>
        		</volist>
        	</tbody>
        </table>

	<div class="pagination">
     {$user->render()}   
    </div>
	</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>